package com.xbongbong.paas.model;


import com.xbongbong.paas.toolbox.wrap.IModel;
import com.xbongbong.pro.domain.entity.FineClueConsumptionEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/***
 * 精线索用量model
 *
 * @author hongxiao
 * @date 2021-12-29 23:25
 */
public interface FineClueConsumptionModel extends IModel<FineClueConsumptionEntity> {
   Integer insert(FineClueConsumptionEntity entity);

   void insertBatch(List<FineClueConsumptionEntity> list);

   List<FineClueConsumptionEntity> findEntitys(Map<String, Object> param);

   Integer getEntitysCount(Map<String, Object> param);

   Integer update(FineClueConsumptionEntity entity);

   void updateBatch( List<FineClueConsumptionEntity> list, String corpid);

   Integer save(FineClueConsumptionEntity entity);

   FineClueConsumptionEntity getByKey(Long key, String corpid);

   List findEntitysWithoutSub(Map<String, Object> param);

   /**
    * 通过精线索数据id获取解锁用量
    *
    * @param corpid 公司id
    * @param pid 精线索数据id
    * @param source 数据来源
    * @return
    */
   FineClueConsumptionEntity getByPid(String corpid, String pid, Integer source);

   /**
    * 通过数据ids获取三方数据id
    *
    * @param corpid 公司id
    * @param dataIdIn 数据ids
    * @param businessType 业务类型
    * @param status 状态
    * @param source 数据来源
    * @return
    */
   List<String> getPidsByDataIdIn(String corpid, List<Long> dataIdIn, Integer businessType, Integer status, Integer source);

   /**
    * 修改用量表状态
    *
    * @param corpid 公司id
    * @param pids 三方数据ids
    * @param status 状态
    * @param source 数据来源
    * @return
    */
   Integer updateStatusByPids(String corpid, List<String> pids, Integer status, Integer source);

   /**
    * 获取所有公司id
    *
    * @return
    */
   List<String> getCorpidList();

   /**
    * 获取未关联数据的pid
    *
    * @param corpid
    * @return
    */
   List<FineClueConsumptionEntity> getPidsByDataIdEmpty(String corpid);
}
